home *** CD-ROM | disk | FTP | other *** search
- Path: is.bbsrc.ac.uk!news
- From: Robert Tuck <Robert.Tuck@bbsrc.ac.uk>
- Newsgroups: comp.lang.c++
- Subject: Re: Recursive Definition?
- Date: 17 Jan 1996 13:11:04 GMT
- Organization: BBSRC
- Message-ID: <4dish8$43c@is.bbsrc.ac.uk>
- References: <4df39j$f80@news.vcd.hp.com>
- NNTP-Posting-Host: pc0075.co.bbsrc.ac.uk
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.22 (Windows; I; 16bit)
-
- [...]
- > static const Switch On;
- > static const Switch Off;
- [...]
- >const Switch Switch::On = 1;
- >const Switch Switch::Off = 0;
- >
- >What are the above two statements trying to initialize?
- >It seems to me that they are sort of doing a recursive
- >initialization. Please help!!!!
-
- It looks to me like On and Off should be ints, not Switchs. The
- respective lines should read:
-
- static const int On;
- static const int Off;
-
- and
-
- const int Switch::On = 1;
- const int Switch::Off = 0;
-
- A member of a class cannot be an object of that same class.
-
- Rob.
-
-
-